package com.medical.assistant.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.http.codec.ServerCodecConfigurer;
import org.springframework.http.codec.json.Jackson2JsonDecoder;
import org.springframework.http.codec.json.Jackson2JsonEncoder;
import org.springframework.web.reactive.config.WebFluxConfigurer;
import com.fasterxml.jackson.databind.ObjectMapper;

@Configuration
public class WebFluxConfig implements WebFluxConfigurer {
    
    @Override
    public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
        // 设置最小缓冲区大小，确保 SSE 数据立即发送
        configurer.defaultCodecs().maxInMemorySize(256);
        configurer.defaultCodecs().enableLoggingRequestDetails(true);
    }
}

